//============================================================================
// Name        : GSP295_Wk4_HashTable
// Author      : Ronald Ram
// Version     :
// Copyright   : GSP295 Wk4 Program - Hash Tables
// Description : Hash Table Implemented as Array in C++
//============================================================================



#ifndef GRAPH_H_
#define GRAPH_H_

//#pragma once

#include <iostream>
#include <string>
using namespace std;



namespace GSP295_Wk5
{
	const int MAX_VERTS = 20;

	struct Vertex
	{
		string data;
		bool wasVisited;

		void Assign(string data, bool visited)
		{
			this->data = data;
			this->wasVisited = visited;
		}

		bool WasVisited()
		{
			return this->wasVisited;
		}

		void SetWasVisited(bool s)
		{
			this->wasVisited = s;
		}
	};


	struct VertexWeighted
	{
		string data;
		int weight;
		bool wasVisited;

		void Assign(string data, bool visited, int weight)
		{
			this->data = data;
			this->weight = weight;
			this->wasVisited = visited;
		}
	};


	class Graph
	{
	private:
		Vertex *vertexList;				//array of Vertices
		int **adjMatrix;				//adjacency matrix
		int size;						//number of Vertices

		void Init();					//C003: Init Method
		bool VertexExists(Vertex v);	//M009: Find if Vertex is in Graph
		int getVertexIndex(Vertex v);	//M010: Return the Index of the Vertex in the graph
		int getAdjVertex_UnVisited(int index);//M011: return Index to next adj vertex in the graph


	public:
		Graph();			//C001: DEFAULT CONSTRUCTOR
		virtual ~Graph();	//C002: DESTRUCTOR

		void MakeEmpty();				//M001: Reset the Graph
		bool isEmpty() const;			//M002: Check if Graph is EMPTY
		bool isFull() const;			//M003: Check if Graph is FULL
		bool AddVertex(Vertex vertex);	//M004: Add a vertex to Graph
		bool AddEdge(Vertex fromVtx, Vertex toVtx, int weight);	//M005: Add an Edge w/ its weight between two Vertices
		int WeightIs(Vertex fromVertex, Vertex toVertex);		//M006: Returns the Weight Value b/w 2 Vertices
		void GetToVertices(Vertex vertex);						//M007: Returns an array of Vertices that are adjacent to vertex
		void DFS(Vertex fromVtx, Vertex toVtx);					//M008: Find the DFS Path between 2 Vertices

		void Print();
	};//class
}//namespace

#endif /*GRAPH_H_*/